package com.fbs.wowo.correctRight.service.imp;

import com.fbs.wowo.correctRight.entity.CertificateType;
import com.fbs.wowo.correctRight.mapper.CertificateTypeMapper;
import com.fbs.wowo.correctRight.service.CertificateTypeService;
import com.fbs.wowo.util.common.ComUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * 证件类型
 */

@Service("CertificateTypeService")
@Transactional
public class CertificateTypeServiceImp implements CertificateTypeService {

    @Resource
    private CertificateTypeMapper certificateTypeMapper;

    /**
     * 添加证件类型
     * @param record
     * @return
     */
    @Override
    public int insertSelective(CertificateType record) {
        record.setCtId(ComUtils.getUUID());
        record.setCreateDate(new Date());
        return certificateTypeMapper.insertSelective(record);
    }

    @Override
    public List<CertificateType> findAll() {
        return certificateTypeMapper.findAll();
    }

    @Override
    public CertificateType selectByPrimaryKey(String id) {
        return certificateTypeMapper.selectByPrimaryKey(id);
    }
}
